package com.jrx.anytxn.transaction.service;

import com.jrx.anytxn.common.exception.TxnBizException;
import com.jrx.anytxn.customer.entity.CmCustomerRightInfo;
import com.jrx.anytxn.customer.entity.TlCouponDetail;
import com.jrx.anytxn.customer.entity.TlRightsExchangeLog;
import com.jrx.anytxn.param.entity.PrSmsSendingRules;
import com.jrx.anytxn.transaction.bean.TemplateWrapper;
import com.jrx.anytxn.transaction.dto.common.SendSmsReq;
import com.jrx.anytxn.transaction.entity.AmLoanMainInfo;
import com.jrx.anytxn.transaction.entity.TlDisbursementLog;
import com.jrx.anytxn.transaction.entity.TlPaymentLog;
import com.jrx.anytxn.transaction.entity.TlRefundLog;
import com.jrx.anytxn.transaction.entity.TlSmsLog;

import java.math.BigDecimal;
import java.net.SocketException;
import java.util.List;

/**
 * 短信处理接口
 * @author lbz
 * date  2019/12/10
 **/
public interface ISmsService {

    /**
     * 放款短信处理 获取短信规则 发送MQ消息
     *
     * @param log 放款流水
     * @author lbz
     * date: 2019/12/10
     */
    void disbursementProcess(TlDisbursementLog log) throws Exception;

    /**
     * 溢缴款短信处理 获取短信规则 发送MQ消息
     *
     * @param log
     * @throws Exception
     * @author liuzb
     * date: 2024/03/04
     */
    void refundSmsProcess(TlRefundLog log) throws Exception;

    /**
     * 还款短信处理 获取短信规则 发送MQ消息
     *
     * @param log 还款流水
     * @author lbz
     * date: 2019/12/10
     */
    void paymentProcess(TlPaymentLog log) throws Exception;

    /**
     * 还款提醒短信处理 根据规则查询还款计划 发送MQ消息
     * @param rulesList
     */
    void payReminderProcess(List<PrSmsSendingRules> rulesList,Integer poolSize);

    /**
     * 组装短信要素类
     * @param tlSmsLog
     * @return
     */
    TemplateWrapper generateTemplateWrapper(TlSmsLog tlSmsLog) throws TxnBizException;

    void smsSendProcess(TlSmsLog tlSmsLog) throws Exception;

    /**
     * 发送微信消息
     * @param tlSmsLog
     */
    void sendWeChat(TlSmsLog tlSmsLog) throws TxnBizException, SocketException;

    /**
     * 发送短信MQ消息
     * @param amLoanMainInfo
     * @param smsType
     * @throws Exception
     */
    void sendSmsMq(AmLoanMainInfo amLoanMainInfo,String smsType) throws Exception;

    /**
     * 兴安花邀新成功提醒 短信
     * @param rightsExchangeLog
     * @param smsType
     * @throws Exception
     */
    void sendSmsMq(TlRightsExchangeLog rightsExchangeLog,String smsType) throws Exception;

    /**
     * 使用优惠券支付抵扣成功短信提醒
     * @param amLoanMainInfo
     * @param totalExemptAmount
     * @param smsType
     */
    void sendSmsMq(AmLoanMainInfo amLoanMainInfo, BigDecimal totalExemptAmount, String smsType) throws Exception;

    /**
     * 发送短信通用服务
     * @param req
     */
    void sendSmsMq(SendSmsReq req) throws Exception;
}
